<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>jQuery AJAX</title>
    <script  src="${pageContext.request.contextPath}/js/jquery-3.5.1.min.js"></script>
</head>
<body>

<div id="info"></div>

<script type="text/javascript">
    $(function(){
        let url = "${pageContext.request.contextPath}/jQueryAjax" ;
        // let data = "username=zhangwuji&password=123&hobbies=eat&hobbies=sleep" ;
        let data = {username:"zhangwuji" , password :"123" , hobbies:["eat" , "sleep"]} ;
        let success = function( data ) {
            console.log( data ) ;
        } ;
        $.post( url , data , success , "json") ;
    }) ;
</script>

</body>
</html>
